/**
  ******************************************************************************
  * @file    SmartSwitch_delay.c 
  * @author  sc
  * @date    2017-04-06
  * @brief   all function of delay
  ******************************************************************************
  */ 

/* Includes ------------------------------------------------------------------*/
#include "SmartSwitch_delay.h"



/*
0x08002468 E000      B        0x0800246C
0x0800246A BF00      NOP      
0x0800246C 1E01      SUBS     r1,r0,#0
0x0800246E F1A00001  SUB      r0,r0,#0x01
0x08002472 D1FA      BNE      0x0800246A
*/
void SC_DelayNop(uint32_t nopCnt)
{
	nopCnt >>= 2;
	while(nopCnt--)
	{
		__NOP();
	}
}

void SC_Delayus(uint32_t us)
{
	uint8_t  i;
	
	while(us--)
	{
		for (i = 0; i < 32; i ++)
		{
			__NOP();
		}
	}
}


void SC_Delayms(uint32_t ms)
{
	OSTimeDly(ms/10);
}


